package com.control.qct.businesssteward.costom;

import com.control.qct.businesssteward.model.GoodsStatisticModel;
import com.github.mikephil.charting.components.AxisBase;
import com.github.mikephil.charting.formatter.IAxisValueFormatter;

import java.util.List;

/**
 * 柱状图底部转换显示样式 --  默认显示int类型
 * Created by Administrator on 2017/12/26 0026.
 */

public class MyXAxisValueFormatter implements IAxisValueFormatter {
    private List<GoodsStatisticModel> data;

    public MyXAxisValueFormatter(List<GoodsStatisticModel> data) {
        this.data = data;
    }

    @Override
    public String getFormattedValue(float value, AxisBase axis) {
//        if (data.size() == 0) {
//            return "";
//        }
//        if (value > data.size()) {
//            return "";
//        }
//        return data.get(((int) value)).getTitle();
        return (int) value + "";
    }

}
